#nullable enable

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using PHMEE.DTOS.Diagnosis;
using PHMEE.IServices.Diagnosis;

namespace PHMEE.Controllers.Diagnosis;

[Route("api/diagnosis/ams-digital")]
public class AmsDigitalController : PHMEEController, IAmsDigitalAppService
{
    private readonly IAmsDigitalAppService _amsDigitalAppService;

    public AmsDigitalController(IAmsDigitalAppService amsDigitalAppService)
    {
        _amsDigitalAppService = amsDigitalAppService;
    }
    
    /// <summary>
    /// 根据 VesselId 和 UnitId 获取该 Unit 的所有 AMS digital 实时值
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="unitId"></param>
    /// <returns></returns>
    [Route("GetLatestDigitalValues")]
    [HttpGet]
    public Task<IEnumerable<DigitalLatestDto>> GetLatestDigitalValuesAsync(Guid vesselId, Guid unitId)
    {
        return _amsDigitalAppService.GetLatestDigitalValuesAsync(vesselId, unitId);
    }
}